import axios from "axios"
export let getlist = (data)=>{
    return (dispatch)=>{
        axios.get("/api/list").then(res=>{
            dispatch({
                type:"getlist",
                payload:res.data,
                payload1:data
            })
        })
    }
}
export let addshop = (item)=>{
    return {
        type:"addshop",
        payload:item
    }
}
export let addFn = (id)=>{
    return {
        type:"addFn",
        payload:id
    }
}
export let delFn = (id)=>{
    return {
        type:"delFn",
        payload:id
    }
}
export let changeitem =(id)=>{
    return {
        type:"changeitem",
        payload:id
    }
}
export let changeAll = ()=>{
    return {
        type:"changeAll"
    }
}
export let getfloorlist = ()=>{  
    return (dispatch)=>{
        return axios.get("/api/floorlist").then(res=>{
            dispatch({
                type:"getfloorlist",
                payload:res.data
            })
        })
    
}}
export let addaddress =(data)=>{
    return {
        type :"addaddress",
        payload:data
    }
}
export let delfn = (index)=>{
    return {
        type:"delfn",
        payload:index
    }
}
export let editfn = (item)=>{
    return {
        type:"editfn",
        payload:item
    }
}